package com.ruoyi.coal.modules.coalpile.service.impl;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.Map;

import com.ruoyi.coal.common.utils.PageUtils;
import com.ruoyi.coal.common.utils.Query;
import com.ruoyi.coal.modules.coalpile.domain.RadarEntity;
import com.ruoyi.coal.modules.coalpile.mapper.RadarDao;
import com.ruoyi.coal.modules.coalpile.service.RadarService;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;

@Service("radarService")
public class RadarServiceImpl extends ServiceImpl<RadarDao, RadarEntity> implements RadarService {
    public PageUtils queryPage(Map<String, Object> params) {
        QueryWrapper<RadarEntity> wrapper = new QueryWrapper();
        if (StringUtils.isNotEmpty((String)params.get("key")))
            wrapper.eq("coal_yard_id", params.get("key"));
        IPage<RadarEntity> page = page((new Query())
                .getPage(params), (Wrapper)wrapper);
        return new PageUtils(page);
    }
}

